
package com.limoilux.cobolux.ui.editor;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;

import com.limoilux.cobolux.ui.text.CobolTokenScanner;


public class CobolSourceViewerConfig extends SourceViewerConfiguration
{
	@Override
	public IPresentationReconciler getPresentationReconciler(ISourceViewer sv)
	{
		PresentationReconciler reconciler = null;
		DefaultDamagerRepairer dmg = null;
		CobolTokenScanner cts = null;

		reconciler = new PresentationReconciler();
		
		cts = new CobolTokenScanner();
		dmg = new DefaultDamagerRepairer(cts);
		reconciler.setDamager(dmg, IDocument.DEFAULT_CONTENT_TYPE);
		reconciler.setRepairer(dmg, IDocument.DEFAULT_CONTENT_TYPE);

		// ... same for other partitions ...
		return reconciler;
	}
}
